package com.yowasa.xiuxian.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.google.common.collect.Lists;
import lombok.Data;

import java.io.Serializable;
import java.text.MessageFormat;
import java.util.ArrayList;

@Data
@TableName("xiuxian_user_extend")
public class XiuXianExtend implements Serializable {

    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @TableId(value = "ID", type = IdType.AUTO)
    private Long id;

    /**
     * 修仙角色id
     */
    private Long accountId;

    //原石
    private Integer rough;

    //树脂
    private Integer resin;

    //食谱
    private String foodList;

    //星辉
    private Integer starlight;

    //深渊层数
    private Integer abyss;

    //精粹
    private Integer quintessence;

    //当前战场层级
    private Integer battleField;

    //战场货币
    private Integer battleGold;

    public XiuXianExtend(Long accountId){
        this.accountId =accountId;
        this.resin = 0;
        this.rough = 0;
        this.starlight = 0;
        this.abyss = 0;
        this.quintessence = 0;
        this.battleField = 0;
        this.battleGold = 0;
    }

    public XiuXianExtend() {
    }

    @Override
    public String toString() {
        ArrayList<String> list = Lists.newArrayList("原初","嚎哭","废土","禁忌","原罪","苦痛","红莲","无限");
        return MessageFormat.format("原石:{0}  星辉:{1}  树脂:{2}  远古意志:{3}  精粹:{4}\n深渊层数：{5}  战场层级：{6}",
                this.rough,this.starlight,this.resin,this.battleGold,this.quintessence,this.abyss,list.get(this.battleField));
    }
}
